<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var name = '李四'
        var obj = {
            name: '张三',
            getName: function () {
                function fn() {
                    console.log(this === window)
                    return this.name
                }
                return fn()
            }
        }
        console.log(obj.getName())
    </script>
</body>

</html>